<?php
$catList	= array('cars', 'ostrict');
$url = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=".$catList [0]."&key=ABQIAAAANfcTXB6Gnx8gKAkpDpnKEhR1toqqKziiUSrTYaJQI98qBmdBXBQ3kzIQ4w5hPCoRh18FF3t4fSVWQw";
// sendRequest
// note how referer is set manually
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, 'http://quine.algorithm.cs.sunysb.edu/naresh');
$body = curl_exec($ch);
curl_close($ch);

// now, process the JSON string
$json = json_decode($body);

print $json;
